package org.example.observer;

import java.util.Map;
import java.util.TreeMap;
import java.util.TreeSet;

public class DistinctSort implements Observer{

    TreeSet<String> set = new TreeSet<>();

    @Override
    public void response(String str) {
        set.add(str);
    }

    @Override
    public void show() {
        System.out.println("----排序----");
        set.forEach(System.out::println);
    }
}
